# !/usr/bin/env python
# encoding: utf-8


"""
  @author: gaogao
  @file: N7744C_App.py
  @time: 2022/3/12 10:41
  @desc:
"""

from ATS.instrumentDriver.InstGenSS.InstGenSS_N7744C import SS_N7744C


class N7744C_App:
    def __init__(self, name):
        self.n7744c = SS_N7744C(name)

    def get_idn(self):
        return self.n7744c.idn()

    def reset(self):
        return self.n7744c.preset()

    def tigger_status(self, state=2):
        self.n7744c.tigger_status(state)

    def set_power_range_auto(self, boolean=1):
        self.n7744c.set_power_range_auto(boolean)

    def set_power_unit(self, power_unit=0):
        self.n7744c.set_power_unit(power_unit)

    def get_power_value(self):
        return self.n7744c.get_power_value()

    def read_power_value(self):
        return self.n7744c.read_power_value()

    def set_auto_gain(self):
        self.n7744c.set_auto_gain()

    def set_power_range(self, power_range=0):
        self.n7744c.set_power_range(power_range)

    def get_power_range(self):
        return self.n7744c.get_power_range()

    def trigger_input_mode(self, mode="SME"):
        self.n7744c.set_trigger_input(mode)

    def set_power_wave_length(self, wave_length=1330):
        self.n7744c.set_power_wave_length(wave_length)

    def set_logging_points(self, points=20000):
        self.n7744c.set_points_average_time(points)

    def get_func_res(self):
        result = self.n7744c.get_array_data()
        return result

    def set_power_atim(self, atim_value="100us"):
        self.n7744c.set_power_atim(atim_value)

    def get_func_state(self):
        return self.n7744c.get_func_state()

    def set_logging_state(self, state="STAR"):
        self.n7744c.set_logging_state(state)

    def init_channel_continous(self):
        self.n7744c.init_channel_continous()
